@layout("/common/_container.html"){
<div>分配医生</div>
<div style="display: none">
    <input type="hidden" id="customerId" value="${customerId}">
    <input type="hidden" id="doctor" value="">
</div>
<!--<label><input class="ipt" type="radio" value="asp" name="me" />asp</label>-->

<div class="content"></div>
<input type="button" value="提交" id="submit" />

<style>
    #chils{
        display: inline-block;
        width: 30%;
    }
</style>

<link rel="stylesheet" href="${ctxPath}/static/css/jqui/jquery-ui.min.css">
<script src="${ctxPath}/static/js/jquery-ui.min.js"></script>
<script src="${ctxPath}/static/modular/tcCenter/consultant/consultant_info.js"></script>
<script>
    //把数据渲染到archiving_content容器里面
    var dom = document.getElementsByClassName('content')[0];
    $.ajax({
        url: Feng.ctxPath + "/consultant/getDoctor",
        type: "get",
        success: function (data) {
            var fragment = document.createDocumentFragment();
            var ul = document.createElement("ul");
            var listr = '';
            for(var i=0;i<data.length;i++){
                listr += "<li id='chils'><label><input class='ipt' type='radio' value='"+data[i].doctor+"' name='me' />"+data[i].doctor+"</label></li>";
            }
            ul.innerHTML = listr;
            fragment.appendChild(ul);
            dom.appendChild(fragment);
        },
        error: function (data) {
            alert('内部故障!');
        }
    });

    var radio = document.getElementsByClassName('ipt');
    var submit = document.getElementById("submit");
    submit.onclick = function(){
        for(var i=0;i<radio.length;i++){
            if(radio[i].checked){
                window.parent.document.getElementById("doctor").value=radio[i].value
            }
        }
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.layer.close(index);
    }
</script>
@}
